package com.liyuhang.controller;

import com.liyuhang.domain.User;
import com.liyuhang.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author : 李宇航
 * @Date: 2018/12/25 0025 09:59
 * @description : 用户控制器
 */
@RestController
@RequestMapping("/user")
public class UserController {
    private UserService userService=new UserService();
    @RequestMapping("/test")
    public String handleTest() {
        return "success";
    }
    @RequestMapping("/login")
    public String handleTest1() {
        if(userService.login(new User("liyuhang","670706603"))){
            return "login success";
        }
        return "login defeated";
    }

}
